//
//  NewsViewCell.m
//  斗鸡TV
//
//  Created by admin on 16/3/21.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "NewsViewCell.h"
@interface NewsViewCell()
{
    UIImageView * img;
    UILabel * titleLable;
    UILabel * briefLable;

    
}
@end

@implementation NewsViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self initView];
    }
    
    return self;
}

-(void)initView
{
    img = [[UIImageView alloc]initWithFrame:CGRectMake(5,10,self.frame.size.width-10,self.frame.size.height-40)];
    img.backgroundColor = [UIColor lightGrayColor];
    img.layer.cornerRadius = 5;
    img.clipsToBounds = YES;
    [self.contentView addSubview:img];
    
    titleLable = [[UILabel alloc]initWithFrame:CGRectMake(5, img.frame.size.height-15, img.frame.size.width-50 , 15)];
    titleLable.font = [UIFont systemFontOfSize:12];
    titleLable.textColor = [UIColor whiteColor];
    //    nickNameLable.backgroundColor = [UIColor orangeColor];
    [img addSubview:titleLable];
    
    CGFloat room_nameLableY = CGRectGetMaxY(img.frame)+5;
    briefLable = [[UILabel alloc]initWithFrame:CGRectMake(5, room_nameLableY, img.frame.size.width, 30)];
    briefLable.font = [UIFont systemFontOfSize:12];
    briefLable.numberOfLines = 0;
    [self.contentView addSubview:briefLable];
    
}

-(void)setCellData:(subNewsModel *)subModel
{
    [img setImageWithURL:[NSURL URLWithString:subModel.imgUrl] placeholderImage:[UIImage imageNamed:@""]];
//    titleLable.text = subModel.title;
    briefLable.text = subModel.title;
}

-(void)setWqCellData:(SubWaQuModel*)wqModel
{
    [img setImageWithURL:[NSURL URLWithString:wqModel.imgUrl] placeholderImage:[UIImage imageNamed:@""]];
        titleLable.text = wqModel.title;
    briefLable.text = wqModel.title;
}

@end
